<!-- CONTENT -->

<?php 
	
	$right1   = $this->getPositionName ('right1');
	$right2 = $this->getPositionName ('right2');
	$right_mass_top = $this->getPositionName ('right-mass-top');
	$right_mass_bottom = $this->getPositionName ('right-mass-bottom');

	$left1   = $this->getPositionName ('left1');
	$left2 = $this->getPositionName ('left2');
	$left_mass_top = $this->getPositionName ('left-mass-top');
	$left_mass_bottom = $this->getPositionName ('left-mass-bottom');

?>

<div id="gk-main" style="width:<?php echo $this->getColumnWidth('m') ?>%">
     <?php
	
		$class_main = '';
 		/*if (($r = $this->getColumnWidth('r')))*/ $class_main .= ' cright';
 		/*if (($l = $this->getColumnWidth('l')))*/ $class_main .= ' cleft';
	
	?>
     <div class="inner ctop<?php echo $class_main; ?> cbottom clearfix">
          <?php 
		$mass_top    = $this->getPositionName ('content-mass-top');
		$mass_bottom = $this->getPositionName ('content-mass-bottom');
		$content_bottom = $this->getPositionName ('content-bottom');
		$content_top = $this->getPositionName ('content-top');
		
		if($this->countModules($mass_top)) : ?>
          <div class="gk-mass gk-mass-top clearfix">
               <jdoc:include type="modules" name="<?php echo $mass_top;?>" style="gavickpro" />
          </div>
          <?php endif; ?>
          <div id="gk-contentwrap">
               <?php
			$inset1 = $this->getPositionName ('inset1');
			$inset2 = $this->getPositionName ('inset2');
							
			?>
               <div id="gk-content" class="column" style="width:<?php echo $this->getColumnWidth('cw') ?>%">
                    <div id="gk-current-content" class="column" style="width:<?php echo $this->getColumnWidth('c') ?>%">
                         <?php
								 
							$class_main = '';
							if(!$this->countModules($right1." + ".$right2." + ".$right_mass_top." + ".$right_mass_bottom) && !$this->countModules($inset2)) $class_main .= ' cright';
							
					?>
                         <div class="inner cleft ctop<?php if(!$this->countModules($mass_bottom)) echo " cbottom"; ?><?php echo $class_main; ?>">
                              <?php 
							if($this->countModules($content_top)) : 
						?>
                              <div class="gk-content-top clearfix">
                                   <div class="inner ctop cleft cright">
                                        <jdoc:include type="modules" name="<?php echo $content_top;?>" style="gavickpro" />
                                   </div>
                              </div>
                              <?php endif; ?>
                              <?php 		
								
							if($this->checkComponent() || $this->checkMainbody()) : 
						?>
							
							<?php if($this->countModules('breadcrumb') || $this->_tpl->params->get("date",1)) : ?>
							<div id="gk-breadcrumb">
								<div class="moduletable">
									<div>
										<div>
											<jdoc:include type="modules" name="breadcrumb" style="none" />
											
											<?php if($this->_tpl->params->get("date",1)) : ?>
											<div id="gk-date">
												<?php echo JHTML::_('date','now',$this->_tpl->params->get("date_format","%A, %d %b %Y")); ?>
											</div>
											<?php endif; ?>
										</div>
									</div>
								</div>
							</div>
							<?php endif; ?>
						
                              <div id="component_wrap" class="clear">
									<div>
	                                    <?php if($this->_tpl->params->get('mainbody_pos') == 0) : ?>
	                                    <div id="component" class="clear">
	                                         <jdoc:include type="component" />
	                                    </div>
	                                    <?php elseif($this->_tpl->params->get('mainbody_pos') == 1) : ?>
	                                    <?php if($this->checkMainbody()) : ?>
	                                    <div id="mainbody">
	                                         <jdoc:include type="modules" name="mainbody" style="gavickpro" additional_class=" clear" />
	                                    </div>
	                                    <?php elseif($this->checkComponent()) : ?>
	                                    <div id="component" class="clear">
	                                         <jdoc:include type="component" />
	                                    </div>
	                                    <?php endif; ?>
	                                    <?php elseif($this->_tpl->params->get('mainbody_pos') == 2) : ?>
	                                    <?php if($this->checkMainbody()) : ?>
	                                    <div id="mainbody" class="clear">
	                                         <jdoc:include type="modules" name="mainbody" style="gavickpro" />
	                                    </div>
	                                    <?php endif; ?>
	                                    <?php if($this->checkComponent()) : ?>
	                                    <div id="component" class="clear">
	                                         <jdoc:include type="component" />
	                                    </div>
	                                    <?php endif; ?>
	                                    <?php else : ?>
	                                    <?php if($this->checkComponent()) : ?>
	                                    <div id="component" class="clear">
	                                         <jdoc:include type="component" />
	                                    </div>
	                                    <?php endif; ?>
	                                    <?php if($this->checkMainbody()) : ?>
	                                    <div id="mainbody" class="clear">
	                                         <jdoc:include type="modules" name="mainbody" style="gavickpro" />
	                                    </div>
	                                    <?php endif; ?>
	                                    <?php endif; ?>
                                    </div>
                              </div>
                              <?php endif; ?>
                              <?php 
							if($this->countModules($content_bottom)) : 
						?>
                              <div class="gk-content-bottom clearfix">
                                   <div class="inner ctop cleft cright">
                                        <jdoc:include type="modules" name="<?php echo $content_bottom;?>" style="gavickpro" />
                                   </div>
                              </div>
                              <?php endif; ?>
                         </div>
                    </div>
                    <?php 
					if($this->countModules($inset1)) : 
				?>
                    <div class="gk-col column gk-inset1" style="width:<?php echo $this->getColumnWidth('i1') ?>%">
                         <div class="inner ctop cleft">
                              <jdoc:include type="modules" name="<?php echo $inset1;?>" style="gavickpro" />
                         </div>
                    </div>
                    <?php endif; ?>
               </div>
               <?php 
				if($this->countModules($inset2)) : 
			?>
               <div class="gk-col column gk-inset2" style="width:<?php echo $this->getColumnWidth('i2') ?>%">
                    <div class="inner cleft ctop<?php if(!$this->countModules($right1." + ".$right2." + ".$right_mass_top." + ".$right_mass_top)) : ?> cright<?php endif; ?>">
                         <jdoc:include type="modules" name="<?php echo $inset2;?>" style="gavickpro" />
                    </div>
               </div>
               <?php endif; ?>
          </div>
          <?php 
			if($this->countModules($mass_bottom)) : ?>
          	<div class="gk-mass gk-mass-bottom clearfix">
              	<div class="inner ctop cleft cright">
			   		<jdoc:include type="modules" name="<?php echo $mass_bottom;?>" style="gavickpro" />
				</div>
  			</div>
    	<?php endif; ?>
     </div>
</div>
<!-- //CONTENT -->